package com.tiny.mirror.service.product.infrastructure.entity.db;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.tiny.mirror.basic.db.mybatis.entity.AuditedEntity;
import com.tiny.mirror.basic.db.mybatis.handler.JacksonTypeHandler;
import com.tiny.mirror.service.product.domain.app.AppParams;
import com.tiny.mirror.service.product.enums.AppStatusEnum;
import com.tiny.mirror.service.product.enums.AppTypeEnum;
import java.math.BigDecimal;
import lombok.Getter;
import lombok.Setter;
import org.apache.ibatis.type.JdbcType;

@Getter
@Setter
@TableName(value = "app", autoResultMap = true)
public class AppEntity extends AuditedEntity<Long> {

  @TableId(value = "id", type = IdType.AUTO)
  private Long id;
  @TableField(value = "name")
  private String name;
  @TableField(value = "price")
  private BigDecimal price;
  @TableField(value = "params", jdbcType = JdbcType.VARCHAR, typeHandler = JacksonTypeHandler.class)
  private AppParams params;
  @TableField(value = "type")
  private AppTypeEnum type;
  @TableField(value = "status")
  private AppStatusEnum status;
  @TableField(value = "order_num")
  private Integer orderNum;
}
